﻿<%@ Page Title="Edit Buy Offer" Language="C#" MasterPageFile="~/UserView.master"
    AutoEventWireup="true" CodeBehind="EditBuyOffer.aspx.cs" Inherits="BestBuy.PageUser.EditBuyOffer" %>

<%@ Register TagPrefix="uc" TagName="ProductDetail" Src="~/UserControl/ProductDetail.ascx" %>
<%@ Register TagPrefix="uc" TagName="SelectCategory" Src="~/UserControl/SelectCategory.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="../Styles/Seller.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/Manager.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Panel ID="Panel2" runat="server" CssClass="left-side-bar bs-docs-sidebar">
        <ul class="nav nav-list bs-docs-sidenav">
            <li class="active" style="text-align: center;"><a href="#">My Buy Offers</a></li>
            <li><a id="A10" runat="server" href="AddBuyOffer.aspx"><i class="icon-chevron-right">
            </i>Add New Buy Offer</a></li>
            <li><a id="A11" runat="server" href="MbBuying.aspx"><i class="icon-chevron-right"></i>
                Manage Buy Offers</a></li>
        </ul>
    </asp:Panel>
    <div class="main-content">
        <asp:ScriptManager ID="ScriptManage1" runat="server">
        </asp:ScriptManager>
        <a style="cursor: pointer" href="MbBuying.aspx">Back</a>
        <asp:Panel ID="ProductDetailPanel" runat="server">
            <h1 style="text-align: center;">
                Edit Buy Offer
            </h1>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
                <ContentTemplate>
                    <table class="table table-bordered" width="100%">
                        <tr>
                            <td width="30%">
                                <asp:Literal ID="litCategory" runat="server" Text="Category"></asp:Literal>
                            </td>
                            <td>
                                <asp:HiddenField ID="HiddenIDBangTinMua" runat="server" />
                                <asp:ListBox ID="CategoryListBox" runat="server" SelectionMode="Single"></asp:ListBox>
                                <a id="lnkPopup" runat="server" style="display: none"></a>
                                <asp:LinkButton ID="lbtnChangeCategory" runat="server" Text="Change Category" OnClick="lbtnChangeCategory_Click"></asp:LinkButton>
                                <asp:Literal ID="ltSpace" runat="server" Text="  |  "></asp:Literal>
                                <asp:LinkButton ID="lbtnRemoveCategory" runat="server" Text="Remove" OnClick="lbtnRemoveCategory_Click"
                                    OnClientClick="javascript:return confirm('Are you sure to remove the selected category?');">
                                </asp:LinkButton>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Literal ID="Literal1" runat="server" Text="Title"></asp:Literal>
                            </td>
                            <td>
                                <asp:TextBox ID="txtTitle" runat="server" Width="80%"></asp:TextBox>
                                <asp:Label ID="Label1" runat="server" ForeColor="#FF3300" Text="*"></asp:Label>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTitle"
                                    Display="None" ErrorMessage="RequiredFieldValidator" ValidationGroup="ProductDetailValidations">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Literal ID="Literal2" runat="server" Text="Keyword"></asp:Literal>
                            </td>
                            <td>
                                <asp:TextBox ID="txtKeyword" runat="server" Width="80%"></asp:TextBox>
                                <asp:Label ID="Label2" runat="server" ForeColor="#FF3300" Text="*"></asp:Label>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtKeyword"
                                    Display="None" ErrorMessage="RequiredFieldValidator" ValidationGroup="ProductDetailValidations">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Literal ID="Literal3" runat="server" Text="Description"></asp:Literal>
                            </td>
                            <td>
                                <asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine" Width="80%"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtDescription"
                                    Display="None" ErrorMessage="RequiredFieldValidator" ValidationGroup="ProductDetailValidations">*</asp:RequiredFieldValidator>
                                <asp:Label ID="Label3" runat="server" ForeColor="#FF3300" Text="*"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Literal ID="Literal4" runat="server" Text="Expiry Time"></asp:Literal>
                            </td>
                            <td>
                                <asp:DropDownList ID="cbExpiryTime" runat="server" Width="150px">
                                    <asp:ListItem Value="7" Text="1 Week"></asp:ListItem>
                                    <asp:ListItem Value="14" Text="2 Week"></asp:ListItem>
                                    <asp:ListItem Value="21" Text="3 Week"></asp:ListItem>
                                    <asp:ListItem Value="" Text="--------------------"></asp:ListItem>
                                    <asp:ListItem Value="30" Text="1 Month"></asp:ListItem>
                                    <asp:ListItem Value="60" Text="2 Month"></asp:ListItem>
                                    <asp:ListItem Value="90" Text="3 Month"></asp:ListItem>
                                    <asp:ListItem Value="120" Text="4 Month"></asp:ListItem>
                                    <asp:ListItem Value="150" Text="5 Month"></asp:ListItem>
                                    <asp:ListItem Value="180" Text="6 Month"></asp:ListItem>
                                    <asp:ListItem Value="" Text="--------------------"></asp:ListItem>
                                    <asp:ListItem Value="365" Text="1 Year"></asp:ListItem>
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="cbExpiryTime"
                                    Display="None" ErrorMessage="RequiredFieldValidator" ValidationGroup="ProductDetailValidations">*</asp:RequiredFieldValidator>
                                <asp:Label ID="Label4" runat="server" ForeColor="#FF3300" Text="*"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Literal ID="Literal5" runat="server" Text="Buying Frequency"></asp:Literal>
                            </td>
                            <td>
                                <asp:DropDownList ID="cbBuyingFrequency" runat="server" Width="150px">
                                    <asp:ListItem Value="" Text="Select"></asp:ListItem>
                                    <asp:ListItem Value="1" Text="Daily"></asp:ListItem>
                                    <asp:ListItem Value="2" Text="One time"></asp:ListItem>
                                    <asp:ListItem Value="3" Text="Monthly"></asp:ListItem>
                                    <asp:ListItem Value="4" Text="Yearly"></asp:ListItem>
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="cbBuyingFrequency"
                                    Display="None" ErrorMessage="RequiredFieldValidator" ValidationGroup="ProductDetailValidations">*</asp:RequiredFieldValidator>
                                <asp:Label ID="Label5" runat="server" ForeColor="#FF3300" Text="*"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Literal ID="Literal6" runat="server" Text="Quantity Required"></asp:Literal>
                            </td>
                            <td>
                                <asp:TextBox runat="server" ID="txtQuantityRequired"></asp:TextBox>
                                <asp:DropDownList ID="cbQuantityRequired" runat="server" Width="150px" AppendDataBoundItems="True">
                                    <asp:ListItem Text="Select"></asp:ListItem>
                                </asp:DropDownList>
                                <asp:RegularExpressionValidator runat="server" ID="valNumbersOnly" ControlToValidate="txtQuantityRequired"
                                    Display="None" ErrorMessage="Please enter number" ValidationExpression="(^([1-9]*|\d*\d{1}?\d*)$)"
                                    ValidationGroup="ProductDetailValidations">*</asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Literal ID="Literal7" runat="server" Text="Annual Purchase Volume"></asp:Literal>
                            </td>
                            <td>
                                <asp:TextBox runat="server" ID="txtAnnualPurchaseVolume"></asp:TextBox>
                                <asp:DropDownList ID="cbAnnualPurchaseVolume" runat="server" Width="150px" AppendDataBoundItems="True">
                                    <asp:ListItem Text="Select"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator1" ControlToValidate="txtAnnualPurchaseVolume"
                                Display="None" ErrorMessage="Please enter number" ValidationExpression="(^([1-9]*|\d*\d{1}?\d*)$)"
                                ValidationGroup="ProductDetailValidations">*</asp:RegularExpressionValidator>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <br />
                                <h2>
                                    Add More Infomation</h2>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Literal ID="Literal8" runat="server" Text="Shipping Terms"></asp:Literal>
                            </td>
                            <td>
                                <asp:TextBox runat="server" ID="txtShippingTerms"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Literal ID="Literal9" runat="server" Text="Destination Port"></asp:Literal>
                            </td>
                            <td>
                                <asp:TextBox runat="server" ID="txtDestinationPort"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top">
                                <asp:Literal ID="Literal10" runat="server" Text="Payment Terms"></asp:Literal>
                            </td>
                            <td>
                                <asp:CheckBoxList ID="PaymentCheckBoxList" runat="server" RepeatDirection="Horizontal"
                                    CssClass="radiobutton">
                                    <asp:ListItem Value="1">Paypal</asp:ListItem>
                                    <asp:ListItem Value="2">Western Union</asp:ListItem>
                                    <asp:ListItem Value="3">Money Gram</asp:ListItem>
                                    <asp:ListItem Value="4">T/T</asp:ListItem>
                                    <asp:ListItem Value="5">D/P</asp:ListItem>
                                    <asp:ListItem Value="6">L/C</asp:ListItem>
                                    <asp:ListItem Value="7">Other</asp:ListItem>
                                </asp:CheckBoxList>
                            </td>
                        </tr>
                    </table>
                    <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="ProductDetailValidations" />
                    <div style="text-align: right; width: 40%" class="DisplayInLine">
                        <asp:Button ID="btnUpdate" CssClass="btn" runat="server" Text="Update" ValidationGroup="ProductDetailValidations"
                            OnClick="btnUpdate_Click" />
                        <asp:Button ID="btnReset" CssClass="btn" runat="server" Text="Reset" OnClick="btnReset_Click" />
                    </div>
                    <asp:Panel ID="pnThongBao" runat="server" CssClass="DisplayInLine">
                        <asp:Label ID="lbThongBao" runat="server" Visible="false"></asp:Label>
                    </asp:Panel>
                    <asp:Panel ID="panEdit" runat="server" CssClass="ModalWindow">
                        <h1 class="PopUp_h1">
                            Select Category
                            <asp:Label ID="lbThongBaoAddCategory" runat="server" Visible="false"></asp:Label>
                        </h1>
                        <div>
                            <asp:Label ID="lbThongBaoLimit" runat="server" Text="Limit quantity to add: "></asp:Label>
                            <asp:Label ID="lbLimitQuantity" runat="server"></asp:Label>
                        </div>
                        <div class="select-category">
                            <asp:GridView ID="gvLevel1" runat="server" AutoGenerateColumns="False" CssClass="gridviewWidth"
                                DataMember="TenDanhMuc" GridLines="None" CellPadding="4" ForeColor="#333333"
                                OnRowDataBound="gvLevel1_OnRowDataBound">
                                <Columns>
                                    <asp:TemplateField ShowHeader="False">
                                        <ItemTemplate>
                                            <asp:Label ID="lbLevel" runat="server" Text=" >>"></asp:Label>
                                            <asp:CheckBox ID="cbLevel" runat="server" Visible="false" AutoPostBack="true" ObjectId='<%# Eval("IDDanhMuc") %>'
                                                OnCheckedChanged="cbLevel_CheckedChanged" />
                                            <asp:LinkButton ID="LinkDanhMuc" runat="server" Text='<%# Eval("TenDanhMuc") %>'
                                                OnClick="LinkDanhMucLevel1_Click" ObjectId='<%# Eval("IDDanhMuc") %>'>
                                            </asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </div>
                        <div class="select-category">
                            <asp:GridView ID="gvLevel2" runat="server" AutoGenerateColumns="False" CssClass="gridviewWidth"
                                DataMember="TenDanhMuc" GridLines="None" CellPadding="4" ForeColor="#333333"
                                OnRowDataBound="gvLevel2_OnRowDataBound">
                                <Columns>
                                    <asp:TemplateField ShowHeader="False">
                                        <ItemTemplate>
                                            <asp:Label ID="lbLevel" runat="server" Text=" >>"></asp:Label>
                                            <asp:CheckBox ID="cbLevel" runat="server" Visible="false" AutoPostBack="true" ObjectId='<%# Eval("IDDanhMuc") %>'
                                                OnCheckedChanged="cbLevel_CheckedChanged" />
                                            <asp:HiddenField ID="hidIDDanhMuc" runat="server" Value='<%# Eval("IDDanhMuc") %>' />
                                            <asp:LinkButton ID="LinkDanhMuc" runat="server" Text='<%# Eval("TenDanhMuc") %>'
                                                OnClick="LinkDanhMucLevel2_Click" ObjectId='<%# Eval("IDDanhMuc") %>'></asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </div>
                        <div class="select-category">
                            <asp:GridView ID="gvLevel3" runat="server" AutoGenerateColumns="False" CssClass="gridviewWidth"
                                DataMember="TenDanhMuc" GridLines="None" CellPadding="4" ForeColor="#333333"
                                OnRowDataBound="gvLevel3_OnRowDataBound">
                                <Columns>
                                    <asp:TemplateField ShowHeader="False">
                                        <ItemTemplate>
                                            <asp:Label ID="lbLevel" runat="server" Text=" >>"></asp:Label>
                                            <asp:CheckBox ID="cbLevel" runat="server" Visible="false" AutoPostBack="true" ObjectId='<%# Eval("IDDanhMuc") %>'
                                                OnCheckedChanged="cbLevel_CheckedChanged" />
                                            <asp:HiddenField ID="hidIDDanhMuc" runat="server" Value='<%# Eval("IDDanhMuc") %>' />
                                            <asp:LinkButton ID="LinkDanhMuc" runat="server" Text='<%# Eval("TenDanhMuc") %>'
                                                OnClick="LinkDanhMucLevel3_Click" ObjectId='<%# Eval("IDDanhMuc") %>'></asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </div>
                        <br />
                        <div style="width: 100%; text-align: center;">
                            <asp:Button ID="btnAddCategory" runat="server" Text="Add Category" OnClick="btnAddCategory_OnClick" />
                            <asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_OnClick" />
                        </div>
                    </asp:Panel>
                    <ajaxToolkit:ModalPopupExtender ID="mpeDanhMuc" runat="server" TargetControlID="lnkPopup"
                        PopupControlID="panEdit" BackgroundCssClass="modalBackground">
                    </ajaxToolkit:ModalPopupExtender>
                </ContentTemplate>
            </asp:UpdatePanel>
        </asp:Panel>
    </div>
</asp:Content>
